# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetails do
  @moduledoc """
  Contains metadata information for the vulnerability. This information is collected from the upstream feed of the operating system.

  ## Attributes

  *   `cve` (*type:* `String.t`, *default:* `nil`) - The CVE of the vulnerability. CVE cannot be empty and the combination of should be unique across vulnerabilities for a VM.
  *   `cvssV2Score` (*type:* `number()`, *default:* `nil`) - The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of 0 - 10 where 0 indicates low severity and 10 indicates high severity.
  *   `cvssV3` (*type:* `GoogleApi.OSConfig.V1.Model.CVSSv3.t`, *default:* `nil`) - The full description of the CVSSv3 for this vulnerability from NVD.
  *   `description` (*type:* `String.t`, *default:* `nil`) - The note or description describing the vulnerability from the distro.
  *   `references` (*type:* `list(GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetailsReference.t)`, *default:* `nil`) - Corresponds to the references attached to the `VulnerabilityDetails`.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - Assigned severity/impact ranking from the distro.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cve => String.t() | nil,
          :cvssV2Score => number() | nil,
          :cvssV3 => GoogleApi.OSConfig.V1.Model.CVSSv3.t() | nil,
          :description => String.t() | nil,
          :references =>
            list(GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetailsReference.t())
            | nil,
          :severity => String.t() | nil
        }

  field(:cve)
  field(:cvssV2Score)
  field(:cvssV3, as: GoogleApi.OSConfig.V1.Model.CVSSv3)
  field(:description)

  field(:references,
    as: GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetailsReference,
    type: :list
  )

  field(:severity)
end

defimpl Poison.Decoder, for: GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetails do
  def decode(value, options) do
    GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetails.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OSConfig.V1.Model.VulnerabilityReportVulnerabilityDetails do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
